import { pubRequire } from '@utils/public'
const baseUrl = '/menus'
//获取列表
export function getMenuList(obj, callBack, errBack) {
  return pubRequire('get', `${baseUrl}`, obj, callBack, errBack)
}
//删除菜单
export function delMenu(id, callBack, errBack) {
  return pubRequire('delete', `${baseUrl}/${id}`, '', callBack, errBack)
}
//菜单名称是否重复
export function repeatMenuName(obj, callBack, errBack) {
  return pubRequire('get', `${baseUrl}/verifications`, obj, callBack, errBack)
}
//获取菜单详情
export function getMenuDetail(menuId, callBack, errBack) {
  return pubRequire('get', `${baseUrl}/${menuId}`, '', callBack, errBack)
}
//编辑菜单
export function editMenu(menuId, obj, callBack, errBack) {
  return pubRequire('put', `${baseUrl}/${menuId}`, obj, callBack, errBack)
}
//新增菜单
export function addMenu(obj, callBack, errBack) {
  return pubRequire('post', `${baseUrl}`, obj, callBack, errBack)
}
